<template>
  <div class="breadcrumb">
    <a-breadcrumb>
      <a-breadcrumb-item
        v-for="(item, index) in hreadcrumbAry"
        :key="index"
        :style="{'cursor': index!=0 && index!=hreadcrumbAry.length-1 ? 'pointer' :''}"
        @click.native="changeItem(item)"
        >{{ item.name }}</a-breadcrumb-item
      >
    </a-breadcrumb>
  </div>
</template>
<script>
export default {
  props: {
    hreadcrumbAry: Array,
  },
  data() {
    return {
      collapsed: false,
    };
  },
  components: {},
  created() {},
  methods: {
    changeItem(item) {
      console.log(item);
      if(item.pre){
        this.$router.go(-1)
      }else{
        this.$router.push({ path: item.path, query: item.query });
      }
    },
  },
};
</script>
<style lang="less" scoped>
@import "~@/assets/css/base.less";
.breadcrumb {
  background: #fff;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 24px;
}
</style>
